Repository navigation
Chore/expire files - #19
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[1.10.0] — unreleased
A backward-compatible minor release adding file expiry / temp files.
Additive; no API removals.
✨ Added
SetFileTTL,SetFileExpiry,PurgeExpired,WithExpirySweeper, and upload-with-TTL:UploadFileWithTTL/UploadFileWithExpiry/UploadFileFromReaderWithTTLContext). Give a file aTTL and buckt permanently deletes it —
blob, image derivatives, and metadata row — once it's due, emitting a
file.purgedevent. A new indexedexpires_atcolumn (schema migration v6,additive) makes the sweep a cheap ranged query. The sweep is app-driven by
default (call
PurgeExpiredfrom your own scheduler);WithExpirySweeperopts into a built-in background ticker (stopped by
Client.Close). Built toextend toward general scheduled actions (e.g. "email this after 24h") on the
same event-backed sweep. The web client exposes it too:
PUT /expiry/:file_id(ttl or absolute RFC3339) and
POST /purge-expiredon the API, and in the UIa per-file "Expire in 1h/24h/7d" menu with an expiry badge (
POST /web/set-ttl/:file_id,POST /web/purge-expired). Theuiexample gains an-expiry=<interval>flag (make ui EXPIRY=30s) to run the sweeper, and a newexample/expiry/headlesswalks the TTL → purge lifecycle.